Fastp

Row

Table

Total after filtering

Total bases after filtering

GC content

Q20

Q30

Passed filter reads

Corrected reads

Corrected bases

Low quality reads

Too many N reads

Too short reads

Low complexity reads

Duplication rate

Packages used

              png            readxl            plotly             dplyr                DT           leaflet 
          "0.1-7"           "1.3.1"          "4.10.0"          "1.0.10"            "0.20"           "2.1.1" 
             ggsn           ggplot2 rnaturalearthdata     rnaturalearth                sf      RColorBrewer 
          "0.5.0"           "3.4.0"           "0.1.0"           "0.1.0"           "1.0-2"           "1.1-3" 
        rmarkdown     flexdashboard 
           "2.11"           "0.6.0" 
---
title: "Fastp"
author: "Pierre Barry"
date: "`r format(Sys.time(), '%d %B, %Y, %H:%M')`"
output: 
  flexdashboard::flex_dashboard:
    theme: paper
    orientation: rows
    social: menu
    source_code: embed
    vertical_layout: scroll
---

```{r global, include=FALSE}

PRINT_IMAGE = 0

list.of.packages <- c("RColorBrewer","DT","ggplot2","png","plotly")

for (i in list.of.packages){
  if (i %in% installed.packages()[,"Package"] == FALSE){
    install.packages(i)
  }
  eval(bquote(library(.(i))))
}
```

```{r, include = FALSE}
color_med_atl=data.frame(Location=c("Gulf of Lion","Costa Calida","Algarve","Bay of Biscay"),
                         Col=brewer.pal(n = 4, name = "RdBu"))
```

Fastp {data-icon="fa-laptop"}
=======================================================================

```{r}
fastp_process<-read.table(paste(path,"/data/fastp/Summary_fastp.txt",sep = ""),sep=";",header=F)


colnames(fastp_process)=c("SAMPLE",
                          "TOTAL_READS_BEFORE_FILTERING","TOTAL_BASES_BEFORE_FILTERING",
                          "GC_CONTENT_BEFORE_FILTERING","Q20_RATE_BEFORE_FILTERING",
                          "Q30_RATE_BEFORE_FILTERING","PASSED_FILTER_READS","CORRECTED_READS","CORRECTED_BASES",
                          "LOW_QUALITY_READS","TOO_MANY_N_READS","TOO_SHORT_READS","LOW_COMPLEXITY_READS",
                          "TOTAL_READS_AFTER_FILTERING","TOTAL_BASES_AFTER_FILTERING",
                          "GC_CONTENT_AFTER_FILTERING","Q20_RATE_AFTER_FILTERING",
                          "Q30_RATE_AFTER_FILTERING","DUPLICATION_RATE")

#fastp_process=fastp_process[-1,]
fastp_process=fastp_process[c("SAMPLE",
                              "TOTAL_READS_BEFORE_FILTERING","TOTAL_BASES_BEFORE_FILTERING",
                              "GC_CONTENT_BEFORE_FILTERING","Q20_RATE_BEFORE_FILTERING",
                              "Q30_RATE_BEFORE_FILTERING",
                              "TOTAL_READS_AFTER_FILTERING","TOTAL_BASES_AFTER_FILTERING",
                              "GC_CONTENT_AFTER_FILTERING","Q20_RATE_AFTER_FILTERING",
                              "Q30_RATE_AFTER_FILTERING",
                              "PASSED_FILTER_READS","CORRECTED_READS","CORRECTED_BASES",
                              "LOW_QUALITY_READS","TOO_MANY_N_READS","TOO_SHORT_READS","LOW_COMPLEXITY_READS",
                              "DUPLICATION_RATE")]

fastp_process$TOTAL_READS_BEFORE_FILTERING=fastp_process$TOTAL_READS_BEFORE_FILTERING/1e9
fastp_process$TOTAL_BASES_BEFORE_FILTERING=fastp_process$TOTAL_BASES_BEFORE_FILTERING/1e9

fastp_process$TOTAL_READS_AFTER_FILTERING=fastp_process$TOTAL_READS_AFTER_FILTERING/1e9
fastp_process$TOTAL_BASES_AFTER_FILTERING=fastp_process$TOTAL_BASES_AFTER_FILTERING/1e9

fastp_process$PASSED_FILTER_READS=fastp_process$PASSED_FILTER_READS/100
fastp_process$CORRECTED_READS=fastp_process$CORRECTED_READS/100
fastp_process$LOW_QUALITY_READS=fastp_process$LOW_QUALITY_READS/100
fastp_process$TOO_SHORT_READS=fastp_process$TOO_SHORT_READS/100

SPECIES=c()
LOCATION=c()
inter=c()
for (i in 1:nrow(fastp_process)){
  
  SPECIES[i]=substr(fastp_process[i,1], start = 1, stop = 5)
  LOCATION[i]=substr(fastp_process[i,1], start = 6, stop = 7)
  inter[i]=as.character(fastp_process$SAMPLE[i])
  
  
}

fastp_process=cbind(SPECIES,fastp_process)
fastp_process=cbind(LOCATION,fastp_process)
fastp_process=fastp_process[order(fastp_process$SAMPLE),]

fastp_process$LOCATION=factor(fastp_process$LOCATION)

Num_batch=c(rep(3,20), #Aboye
            rep(3,14), #Afall
            rep(2,1),rep(3,4),rep(2,15), #Cgale
            rep(2,20), #Cjuli
            rep(1,20), #Dlabr
            rep(2,22), #Dpunt
            rep(2,20), #Eecnr
            rep(3,20), #Gnige
            rep(3,5),rep(2,1),rep(3,3),rep(2,6),rep(3,3),rep(2,12), #Hgutt
            rep(2,5),rep(1,2),rep(2,6),rep(1,2),rep(2,5), #Lbude
            rep(1,20), #Lmorm
            rep(1,20), #Mmerl
            rep(1,20), #Msurm
            rep(1,20), #Peryt
            rep(1,7),rep(2,5),rep(1,10), #Scabr
            rep(2,14),rep(3,1),rep(2,5), #Scant
            rep(3,5),rep(2,2),rep(3,1),rep(2,1),rep(3,1),rep(2,4),rep(3,1),rep(2,3),rep(3,2), #Scine
            rep(1,20), #Spilc
            rep(1,14),2,rep(1,5), #Ssard
            rep(2,22) #Styph
)

fastp_process$Num_batch=as.factor(Num_batch)

redo=c()
for (i in 1:nrow(fastp_process)){
  
  if (substr(fastp_process[i,3], start = 9, stop = 10)=="B" | substr(fastp_process[i,3], start = 9, stop = 10)=="A"){
    redo[i]=18
  } else {
    redo[i]=19
  }
  
}

fastp_process$redo=as.character(redo)

color=c()
for (i in 1:nrow(fastp_process)){
  
  color[i]=as.character(color_med_atl[which(fastp_process$LOCATION[i]==color_med_atl$Location),2])
  
}

fastp_process$color=color


for (i in 1:nrow(fastp_process)){
  
  if (substr(fastp_process[i,3], start = 9, stop = 10)=="B"){
    fastp_process$SAMPLE[i]=substr(fastp_process[i,3], start = 1, stop = 8)
  } 
  
}

fastp_process$SPECIES=factor(fastp_process$SPECIES)

num<-which(substr(fastp_process[,3], start = 9, stop = 10)=="_B" | substr(fastp_process[,3], start = 9, stop = 10)=="_A")
fastp_process=fastp_process[-num,]

for (i in 1:nrow(fastp_process)){
  fastp_process$SAMPLE[i]=gsub("_.*","",fastp_process$SAMPLE[i])
}

analogy_legend=c(NA,NA,NA,
                 "Total reads before filtering ",    
                 "Total bases before filtering (Gb)",
                 "GC content before filtering (%)",
                 "Q20 rate before filtering (%)",
                 "Q30 rate before filtering (%)",
                 "Total reads after filtering (10⁹)",
                 "Total bases after filtering (Gb)",
                 "GC content after filtering (%)",
                 "Q20 rate after filtering (%)",
                 "Q30 rate after filtering (%)",
                 "Passed filter reads (%)",
                 "Corrected reads (%)",
                 "Corrected bases (%)",
                 "Low quality reads (%)",
                 "Too many N reads (%)",
                 "Too short reads (%)",
                 "Low complexity reads (%)",
                 "Duplication rate (%)")

fastp_plot=data.frame(LOCATION=rep(fastp_process$LOCATION,18),
                      SPECIES=rep(fastp_process$SPECIES,18),
                      SAMPLE=rep(fastp_process$SAMPLE,18),
                      param=rep(NA,nrow(fastp_process)*18),
                      value=rep(0,nrow(fastp_process)*18))

a=1
for (i in 4:21){
  for (j in 1:nrow(fastp_process)){
    fastp_plot$param[a]=colnames(fastp_process)[i]
    fastp_plot$value[a]=fastp_process[j,i]
    a=a+1
  }
} 

fastp_plot=fastp_plot[is.na(fastp_plot$param)==FALSE,]


labels_species=c()

for (sp in 1:length(levels(fastp_process$SPECIES))){
  
  labels_species=c(labels_species,
                   paste(levels(fastp_process$SPECIES)[sp]," \n n = ",table(fastp_process$SPECIES)[sp],sep=" "))
  
}

labels_species=as.vector(labels_species)

fastp_plot$LOCATION=factor(fastp_process$LOCATION,levels=c("Li","Mu","Fa","Ga"))
```

Row {.tabset}
-----------------------------------------------------------------------

### Table {data-height=750}
  
```{r}
a=0
height=2.5
width=7.5
```

```{r}
datatable(fastp_process, 
          class = 'cell-border stripe',
          rownames = FALSE,
          filter = 'top', options = list(
          pageLength = 100,scrollY=500,autowidth=T,scrollX=100))
```

### Total after filtering

```{r}
ppp <- ggplot(fastp_plot[fastp_plot$param=="TOTAL_READS_AFTER_FILTERING",], aes(x=SPECIES, y=value))  +
  geom_violin(fill="chartreuse3",col="black",alpha=0.25) +
  #geom_boxplot(outlier.shape = NA,
  #             outlier.size = 0.000001,
  #             alpha=0.5,
  #             width=0.1,
  #             show.legend = F)+
  geom_point(aes(col=LOCATION,
                 text=paste("Sample: ",SAMPLE, " \n Total reads:",round(value,3),sep="")),size = 1,
             position='jitter',
             alpha=0.75)+
  #stat_summary(fun.data=data_summary,geom="point", size=2, color="orange")+
  stat_summary(fun=median, geom="point", size=2, color="orange")+
  scale_x_discrete(name="Species",
                   labels=labels_species)+
  ylab("Total reads after filtering (10^9 bp)")+
  xlab("Species")+
  theme_classic()+
  scale_colour_manual(name = "",
                      labels = c("Gulf of Lion","Costa Calida","Algarve","Bay of Biscay"),
                      values = brewer.pal(n = 4, name = "RdBu"))+
  theme(legend.position="bottom")

ppp<-ggplotly(ppp,tooltip=c("text"))  %>% partial_bundle() 

if (PRINT_IMAGE==1){
img1<-readPNG(paste(path,"/figures/fish/","Aboye",".png",sep=""))
img2<-readPNG(paste(path,"/figures/fish/","Afall",".png",sep=""))
img3<-readPNG(paste(path,"/figures/fish/","Cgale",".png",sep=""))
img4<-readPNG(paste(path,"/figures/fish/","Cjuli",".png",sep=""))
img5<-readPNG(paste(path,"/figures/fish/","Dlabr",".png",sep=""))
img6<-readPNG(paste(path,"/figures/fish/","Dpunt",".png",sep=""))
img7<-readPNG(paste(path,"/figures/fish/","Eencr",".png",sep=""))
img8<-readPNG(paste(path,"/figures/fish/","Gnige",".png",sep=""))
img9<-readPNG(paste(path,"/figures/fish/","Hgutt",".png",sep=""))
img10<-readPNG(paste(path,"/figures/fish/","Lbude",".png",sep=""))
img11<-readPNG(paste(path,"/figures/fish/","Lmorm",".png",sep=""))
img12<-readPNG(paste(path,"/figures/fish/","Mmerl",".png",sep=""))
img13<-readPNG(paste(path,"/figures/fish/","Msurm",".png",sep=""))
img14<-readPNG(paste(path,"/figures/fish/","Peryt",".png",sep=""))
img15<-readPNG(paste(path,"/figures/fish/","Scabr",".png",sep=""))
img16<-readPNG(paste(path,"/figures/fish/","Scant",".png",sep=""))
img17<-readPNG(paste(path,"/figures/fish/","Scine",".png",sep=""))
img18<-readPNG(paste(path,"/figures/fish/","Spilc",".png",sep=""))
img19<-readPNG(paste(path,"/figures/fish/","Ssard",".png",sep=""))
img20<-readPNG(paste(path,"/figures/fish/","Styph",".png",sep=""))
start=0
end=0.95
vv<-seq(start,end,length.out=20)
size.x=vv[2]-vv[1]
ppp<-  ppp %>%
  layout(
    images = list(
      list(
        source = raster2uri(as.raster(img1)),
        x = vv[1], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img2)),
        x = vv[2], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img3)),
        x = vv[3], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img4)),
        x = vv[4], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img5)),
        x = vv[5], y = 1, 
        sizex = size.x, sizey = 0.05
      ),
      list(
        source = raster2uri(as.raster(img6)),
        x = vv[6], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img7)),
        x = vv[7], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img8)),
        x = vv[8], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img9)),
        x = vv[9], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img10)),
        x = vv[10], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img11)),
        x = vv[11], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img12)),
        x = vv[12], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img13)),
        x = vv[13], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img14)),
        x = vv[14],y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img15)),
        x = vv[15], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img16)),
        x = vv[16], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img17)),
        x = vv[17], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img18)),
        x = vv[18], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img19)),
        x = vv[19], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img20)),
        x = vv[20], y = 1, 
        sizex = size.x, sizey = 0.1
      )
    )
  ) 
}
ppp

```

### Total bases after filtering

```{r}
ppp <- ggplot(fastp_plot[fastp_plot$param=="TOTAL_BASES_AFTER_FILTERING",], aes(x=SPECIES, y=value))  +
  geom_violin(fill="chartreuse3",col="black",alpha=0.25) +
  #geom_boxplot(outlier.shape = NA,
  #             outlier.size = 0.000001,
  #             alpha=0.5,
  #             width=0.1,
  #             show.legend = F)+
  geom_point(aes(col=LOCATION,
                 text=paste("Sample: ",SAMPLE, " \n Total bases:",round(value,3),sep="")),size = 1,
             position='jitter',
             alpha=0.75)+
  #stat_summary(fun.data=data_summary,geom="point", size=2, color="orange")+
  stat_summary(fun=median, geom="point", size=2, color="orange")+
  scale_x_discrete(name="Species",
                   labels=labels_species)+
  ylab("Total bases after filtering (10^9 bp)")+
  xlab("Species")+
  theme_classic()+
  scale_colour_manual(name = "",
                      labels = c("Gulf of Lion","Costa Calida","Algarve","Bay of Biscay"),
                      values = brewer.pal(n = 4, name = "RdBu"))+
  theme(legend.position="bottom")
ppp<-ggplotly(ppp,tooltip=c("text"))  %>% partial_bundle() 

if (PRINT_IMAGE==1){
img1<-readPNG(paste(path,"/figures/fish/","Aboye",".png",sep=""))
img2<-readPNG(paste(path,"/figures/fish/","Afall",".png",sep=""))
img3<-readPNG(paste(path,"/figures/fish/","Cgale",".png",sep=""))
img4<-readPNG(paste(path,"/figures/fish/","Cjuli",".png",sep=""))
img5<-readPNG(paste(path,"/figures/fish/","Dlabr",".png",sep=""))
img6<-readPNG(paste(path,"/figures/fish/","Dpunt",".png",sep=""))
img7<-readPNG(paste(path,"/figures/fish/","Eencr",".png",sep=""))
img8<-readPNG(paste(path,"/figures/fish/","Gnige",".png",sep=""))
img9<-readPNG(paste(path,"/figures/fish/","Hgutt",".png",sep=""))
img10<-readPNG(paste(path,"/figures/fish/","Lbude",".png",sep=""))
img11<-readPNG(paste(path,"/figures/fish/","Lmorm",".png",sep=""))
img12<-readPNG(paste(path,"/figures/fish/","Mmerl",".png",sep=""))
img13<-readPNG(paste(path,"/figures/fish/","Msurm",".png",sep=""))
img14<-readPNG(paste(path,"/figures/fish/","Peryt",".png",sep=""))
img15<-readPNG(paste(path,"/figures/fish/","Scabr",".png",sep=""))
img16<-readPNG(paste(path,"/figures/fish/","Scant",".png",sep=""))
img17<-readPNG(paste(path,"/figures/fish/","Scine",".png",sep=""))
img18<-readPNG(paste(path,"/figures/fish/","Spilc",".png",sep=""))
img19<-readPNG(paste(path,"/figures/fish/","Ssard",".png",sep=""))
img20<-readPNG(paste(path,"/figures/fish/","Styph",".png",sep=""))
start=0
end=0.95
vv<-seq(start,end,length.out=20)
size.x=vv[2]-vv[1]
ppp<-  ppp %>%
  layout(
    images = list(
      list(
        source = raster2uri(as.raster(img1)),
        x = vv[1], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img2)),
        x = vv[2], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img3)),
        x = vv[3], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img4)),
        x = vv[4], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img5)),
        x = vv[5], y = 1, 
        sizex = size.x, sizey = 0.05
      ),
      list(
        source = raster2uri(as.raster(img6)),
        x = vv[6], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img7)),
        x = vv[7], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img8)),
        x = vv[8], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img9)),
        x = vv[9], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img10)),
        x = vv[10], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img11)),
        x = vv[11], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img12)),
        x = vv[12], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img13)),
        x = vv[13], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img14)),
        x = vv[14],y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img15)),
        x = vv[15], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img16)),
        x = vv[16], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img17)),
        x = vv[17], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img18)),
        x = vv[18], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img19)),
        x = vv[19], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img20)),
        x = vv[20], y = 1, 
        sizex = size.x, sizey = 0.1
      )
    )
  ) 
}

ppp

```

### GC content

```{r}
ppp <- ggplot(fastp_plot[fastp_plot$param=="GC_CONTENT_AFTER_FILTERING",], aes(x=SPECIES, y=value))  +
  geom_violin(fill="chartreuse3",col="black",alpha=0.25) +
  #geom_boxplot(outlier.shape = NA,
  #             outlier.size = 0.000001,
  #             alpha=0.5,
  #             width=0.1,
  #             show.legend = F)+
  geom_point(aes(col=LOCATION,
                 text=paste("Sample: ",SAMPLE, " \n GC content:",round(value,3),sep="")),size = 1,
             position='jitter',
             alpha=0.75)+
  #stat_summary(fun.data=data_summary,geom="point", size=2, color="orange")+
  stat_summary(fun=median, geom="point", size=2, color="orange")+
  scale_x_discrete(name="Species",
                   labels=labels_species)+
  ylab("GC content (%)")+
  xlab("Species")+
  theme_classic()+
  scale_colour_manual(name = "",
                      labels = c("Gulf of Lion","Costa Calida","Algarve","Bay of Biscay"),
                      values = brewer.pal(n = 4, name = "RdBu"))+
  theme(legend.position="bottom")
ppp<-ggplotly(ppp,tooltip=c("text"))  %>% partial_bundle() 

if (PRINT_IMAGE==1){
img1<-readPNG(paste(path,"/figures/fish/","Aboye",".png",sep=""))
img2<-readPNG(paste(path,"/figures/fish/","Afall",".png",sep=""))
img3<-readPNG(paste(path,"/figures/fish/","Cgale",".png",sep=""))
img4<-readPNG(paste(path,"/figures/fish/","Cjuli",".png",sep=""))
img5<-readPNG(paste(path,"/figures/fish/","Dlabr",".png",sep=""))
img6<-readPNG(paste(path,"/figures/fish/","Dpunt",".png",sep=""))
img7<-readPNG(paste(path,"/figures/fish/","Eencr",".png",sep=""))
img8<-readPNG(paste(path,"/figures/fish/","Gnige",".png",sep=""))
img9<-readPNG(paste(path,"/figures/fish/","Hgutt",".png",sep=""))
img10<-readPNG(paste(path,"/figures/fish/","Lbude",".png",sep=""))
img11<-readPNG(paste(path,"/figures/fish/","Lmorm",".png",sep=""))
img12<-readPNG(paste(path,"/figures/fish/","Mmerl",".png",sep=""))
img13<-readPNG(paste(path,"/figures/fish/","Msurm",".png",sep=""))
img14<-readPNG(paste(path,"/figures/fish/","Peryt",".png",sep=""))
img15<-readPNG(paste(path,"/figures/fish/","Scabr",".png",sep=""))
img16<-readPNG(paste(path,"/figures/fish/","Scant",".png",sep=""))
img17<-readPNG(paste(path,"/figures/fish/","Scine",".png",sep=""))
img18<-readPNG(paste(path,"/figures/fish/","Spilc",".png",sep=""))
img19<-readPNG(paste(path,"/figures/fish/","Ssard",".png",sep=""))
img20<-readPNG(paste(path,"/figures/fish/","Styph",".png",sep=""))
start=0
end=0.95
vv<-seq(start,end,length.out=20)
size.x=vv[2]-vv[1]
ppp<-  ppp %>%
  layout(
    images = list(
      list(
        source = raster2uri(as.raster(img1)),
        x = vv[1], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img2)),
        x = vv[2], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img3)),
        x = vv[3], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img4)),
        x = vv[4], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img5)),
        x = vv[5], y = 1, 
        sizex = size.x, sizey = 0.05
      ),
      list(
        source = raster2uri(as.raster(img6)),
        x = vv[6], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img7)),
        x = vv[7], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img8)),
        x = vv[8], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img9)),
        x = vv[9], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img10)),
        x = vv[10], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img11)),
        x = vv[11], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img12)),
        x = vv[12], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img13)),
        x = vv[13], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img14)),
        x = vv[14],y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img15)),
        x = vv[15], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img16)),
        x = vv[16], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img17)),
        x = vv[17], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img18)),
        x = vv[18], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img19)),
        x = vv[19], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img20)),
        x = vv[20], y = 1, 
        sizex = size.x, sizey = 0.1
      )
    )
  ) 
}

ppp

```

### Q20

```{r}
ppp <- ggplot(fastp_plot[fastp_plot$param=="Q20_RATE_AFTER_FILTERING",], aes(x=SPECIES, y=value))  +
  geom_violin(fill="chartreuse3",col="black",alpha=0.25) +
  #geom_boxplot(outlier.shape = NA,
  #             outlier.size = 0.000001,
  #             alpha=0.5,
  #             width=0.1,
  #             show.legend = F)+
  geom_point(aes(col=LOCATION,
                 text=paste("Sample: ",SAMPLE, " \n Q20:",round(value,3),sep="")),size = 1,
             position='jitter',
             alpha=0.75)+
  #stat_summary(fun.data=data_summary,geom="point", size=2, color="orange")+
  stat_summary(fun=median, geom="point", size=2, color="orange")+
  scale_x_discrete(name="Species",
                   labels=labels_species)+
  ylab("Q20 (%)")+
  xlab("Species")+
  theme_classic()+
  scale_colour_manual(name = "",
                      labels = c("Gulf of Lion","Costa Calida","Algarve","Bay of Biscay"),
                      values = brewer.pal(n = 4, name = "RdBu"))+
  theme(legend.position="bottom")
ppp<-ggplotly(ppp,tooltip=c("text"))  %>% partial_bundle() 

if (PRINT_IMAGE==1){
img1<-readPNG(paste(path,"/figures/fish/","Aboye",".png",sep=""))
img2<-readPNG(paste(path,"/figures/fish/","Afall",".png",sep=""))
img3<-readPNG(paste(path,"/figures/fish/","Cgale",".png",sep=""))
img4<-readPNG(paste(path,"/figures/fish/","Cjuli",".png",sep=""))
img5<-readPNG(paste(path,"/figures/fish/","Dlabr",".png",sep=""))
img6<-readPNG(paste(path,"/figures/fish/","Dpunt",".png",sep=""))
img7<-readPNG(paste(path,"/figures/fish/","Eencr",".png",sep=""))
img8<-readPNG(paste(path,"/figures/fish/","Gnige",".png",sep=""))
img9<-readPNG(paste(path,"/figures/fish/","Hgutt",".png",sep=""))
img10<-readPNG(paste(path,"/figures/fish/","Lbude",".png",sep=""))
img11<-readPNG(paste(path,"/figures/fish/","Lmorm",".png",sep=""))
img12<-readPNG(paste(path,"/figures/fish/","Mmerl",".png",sep=""))
img13<-readPNG(paste(path,"/figures/fish/","Msurm",".png",sep=""))
img14<-readPNG(paste(path,"/figures/fish/","Peryt",".png",sep=""))
img15<-readPNG(paste(path,"/figures/fish/","Scabr",".png",sep=""))
img16<-readPNG(paste(path,"/figures/fish/","Scant",".png",sep=""))
img17<-readPNG(paste(path,"/figures/fish/","Scine",".png",sep=""))
img18<-readPNG(paste(path,"/figures/fish/","Spilc",".png",sep=""))
img19<-readPNG(paste(path,"/figures/fish/","Ssard",".png",sep=""))
img20<-readPNG(paste(path,"/figures/fish/","Styph",".png",sep=""))
start=0
end=0.95
vv<-seq(start,end,length.out=20)
size.x=vv[2]-vv[1]
ppp<-  ppp %>%
  layout(
    images = list(
      list(
        source = raster2uri(as.raster(img1)),
        x = vv[1], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img2)),
        x = vv[2], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img3)),
        x = vv[3], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img4)),
        x = vv[4], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img5)),
        x = vv[5], y = 1, 
        sizex = size.x, sizey = 0.05
      ),
      list(
        source = raster2uri(as.raster(img6)),
        x = vv[6], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img7)),
        x = vv[7], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img8)),
        x = vv[8], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img9)),
        x = vv[9], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img10)),
        x = vv[10], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img11)),
        x = vv[11], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img12)),
        x = vv[12], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img13)),
        x = vv[13], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img14)),
        x = vv[14],y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img15)),
        x = vv[15], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img16)),
        x = vv[16], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img17)),
        x = vv[17], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img18)),
        x = vv[18], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img19)),
        x = vv[19], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img20)),
        x = vv[20], y = 1, 
        sizex = size.x, sizey = 0.1
      )
    )
  ) 
}

ppp

```

### Q30

```{r}
ppp <- ggplot(fastp_plot[fastp_plot$param=="Q30_RATE_AFTER_FILTERING",], aes(x=SPECIES, y=value))  +
  geom_violin(fill="chartreuse3",col="black",alpha=0.25) +
  #geom_boxplot(outlier.shape = NA,
  #             outlier.size = 0.000001,
  #             alpha=0.5,
  #             width=0.1,
  #             show.legend = F)+
  geom_point(aes(col=LOCATION,
                 text=paste("Sample: ",SAMPLE, " \n Q30:",round(value,3),sep="")),size = 1,
             position='jitter',
             alpha=0.75)+
  #stat_summary(fun.data=data_summary,geom="point", size=2, color="orange")+
  stat_summary(fun=median, geom="point", size=2, color="orange")+
  scale_x_discrete(name="Species",
                   labels=labels_species)+
  ylab("Q30 (%)")+
  xlab("Species")+
  theme_classic()+
  scale_colour_manual(name = "",
                      labels = c("Gulf of Lion","Costa Calida","Algarve","Bay of Biscay"),
                      values = brewer.pal(n = 4, name = "RdBu"))+
  theme(legend.position="bottom")
ppp<-ggplotly(ppp,tooltip=c("text"))  %>% partial_bundle() 

if (PRINT_IMAGE==1){
img1<-readPNG(paste(path,"/figures/fish/","Aboye",".png",sep=""))
img2<-readPNG(paste(path,"/figures/fish/","Afall",".png",sep=""))
img3<-readPNG(paste(path,"/figures/fish/","Cgale",".png",sep=""))
img4<-readPNG(paste(path,"/figures/fish/","Cjuli",".png",sep=""))
img5<-readPNG(paste(path,"/figures/fish/","Dlabr",".png",sep=""))
img6<-readPNG(paste(path,"/figures/fish/","Dpunt",".png",sep=""))
img7<-readPNG(paste(path,"/figures/fish/","Eencr",".png",sep=""))
img8<-readPNG(paste(path,"/figures/fish/","Gnige",".png",sep=""))
img9<-readPNG(paste(path,"/figures/fish/","Hgutt",".png",sep=""))
img10<-readPNG(paste(path,"/figures/fish/","Lbude",".png",sep=""))
img11<-readPNG(paste(path,"/figures/fish/","Lmorm",".png",sep=""))
img12<-readPNG(paste(path,"/figures/fish/","Mmerl",".png",sep=""))
img13<-readPNG(paste(path,"/figures/fish/","Msurm",".png",sep=""))
img14<-readPNG(paste(path,"/figures/fish/","Peryt",".png",sep=""))
img15<-readPNG(paste(path,"/figures/fish/","Scabr",".png",sep=""))
img16<-readPNG(paste(path,"/figures/fish/","Scant",".png",sep=""))
img17<-readPNG(paste(path,"/figures/fish/","Scine",".png",sep=""))
img18<-readPNG(paste(path,"/figures/fish/","Spilc",".png",sep=""))
img19<-readPNG(paste(path,"/figures/fish/","Ssard",".png",sep=""))
img20<-readPNG(paste(path,"/figures/fish/","Styph",".png",sep=""))
start=0
end=0.95
vv<-seq(start,end,length.out=20)
size.x=vv[2]-vv[1]
ppp<-  ppp %>%
  layout(
    images = list(
      list(
        source = raster2uri(as.raster(img1)),
        x = vv[1], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img2)),
        x = vv[2], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img3)),
        x = vv[3], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img4)),
        x = vv[4], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img5)),
        x = vv[5], y = 1, 
        sizex = size.x, sizey = 0.05
      ),
      list(
        source = raster2uri(as.raster(img6)),
        x = vv[6], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img7)),
        x = vv[7], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img8)),
        x = vv[8], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img9)),
        x = vv[9], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img10)),
        x = vv[10], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img11)),
        x = vv[11], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img12)),
        x = vv[12], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img13)),
        x = vv[13], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img14)),
        x = vv[14],y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img15)),
        x = vv[15], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img16)),
        x = vv[16], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img17)),
        x = vv[17], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img18)),
        x = vv[18], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img19)),
        x = vv[19], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img20)),
        x = vv[20], y = 1, 
        sizex = size.x, sizey = 0.1
      )
    )
  ) 
}

ppp

```

### Passed filter reads

```{r}
ppp <- ggplot(fastp_plot[fastp_plot$param=="PASSED_FILTER_READS",], aes(x=SPECIES, y=value))  +
  geom_violin(fill="chartreuse3",col="black",alpha=0.25) +
  #geom_boxplot(outlier.shape = NA,
  #             outlier.size = 0.000001,
  #             alpha=0.5,
  #             width=0.1,
  #             show.legend = F)+
  geom_point(aes(col=LOCATION,
                 text=paste("Sample: ",SAMPLE, " \n Passed filter reads:",round(value,3),sep="")),size = 1,
             position='jitter',
             alpha=0.75)+
  #stat_summary(fun.data=data_summary,geom="point", size=2, color="orange")+
  stat_summary(fun=median, geom="point", size=2, color="orange")+
  scale_x_discrete(name="Species",
                   labels=labels_species)+
  ylab("Passed filter reads (%)")+
  xlab("Species")+
  theme_classic()+
  scale_colour_manual(name = "",
                      labels = c("Gulf of Lion","Costa Calida","Algarve","Bay of Biscay"),
                      values = brewer.pal(n = 4, name = "RdBu"))+
  theme(legend.position="bottom")
ppp<-ggplotly(ppp,tooltip=c("text"))  %>% partial_bundle() 

if (PRINT_IMAGE==1){
img1<-readPNG(paste(path,"/figures/fish/","Aboye",".png",sep=""))
img2<-readPNG(paste(path,"/figures/fish/","Afall",".png",sep=""))
img3<-readPNG(paste(path,"/figures/fish/","Cgale",".png",sep=""))
img4<-readPNG(paste(path,"/figures/fish/","Cjuli",".png",sep=""))
img5<-readPNG(paste(path,"/figures/fish/","Dlabr",".png",sep=""))
img6<-readPNG(paste(path,"/figures/fish/","Dpunt",".png",sep=""))
img7<-readPNG(paste(path,"/figures/fish/","Eencr",".png",sep=""))
img8<-readPNG(paste(path,"/figures/fish/","Gnige",".png",sep=""))
img9<-readPNG(paste(path,"/figures/fish/","Hgutt",".png",sep=""))
img10<-readPNG(paste(path,"/figures/fish/","Lbude",".png",sep=""))
img11<-readPNG(paste(path,"/figures/fish/","Lmorm",".png",sep=""))
img12<-readPNG(paste(path,"/figures/fish/","Mmerl",".png",sep=""))
img13<-readPNG(paste(path,"/figures/fish/","Msurm",".png",sep=""))
img14<-readPNG(paste(path,"/figures/fish/","Peryt",".png",sep=""))
img15<-readPNG(paste(path,"/figures/fish/","Scabr",".png",sep=""))
img16<-readPNG(paste(path,"/figures/fish/","Scant",".png",sep=""))
img17<-readPNG(paste(path,"/figures/fish/","Scine",".png",sep=""))
img18<-readPNG(paste(path,"/figures/fish/","Spilc",".png",sep=""))
img19<-readPNG(paste(path,"/figures/fish/","Ssard",".png",sep=""))
img20<-readPNG(paste(path,"/figures/fish/","Styph",".png",sep=""))
start=0
end=0.95
vv<-seq(start,end,length.out=20)
size.x=vv[2]-vv[1]
ppp<-  ppp %>%
  layout(
    images = list(
      list(
        source = raster2uri(as.raster(img1)),
        x = vv[1], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img2)),
        x = vv[2], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img3)),
        x = vv[3], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img4)),
        x = vv[4], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img5)),
        x = vv[5], y = 1, 
        sizex = size.x, sizey = 0.05
      ),
      list(
        source = raster2uri(as.raster(img6)),
        x = vv[6], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img7)),
        x = vv[7], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img8)),
        x = vv[8], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img9)),
        x = vv[9], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img10)),
        x = vv[10], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img11)),
        x = vv[11], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img12)),
        x = vv[12], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img13)),
        x = vv[13], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img14)),
        x = vv[14],y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img15)),
        x = vv[15], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img16)),
        x = vv[16], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img17)),
        x = vv[17], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img18)),
        x = vv[18], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img19)),
        x = vv[19], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img20)),
        x = vv[20], y = 1, 
        sizex = size.x, sizey = 0.1
      )
    )
  ) 
}

ppp

```

### Corrected reads

```{r}
ppp <- ggplot(fastp_plot[fastp_plot$param=="CORRECTED_READS",], aes(x=SPECIES, y=value))  +
  geom_violin(fill="chartreuse3",col="black",alpha=0.25) +
  #geom_boxplot(outlier.shape = NA,
  #             outlier.size = 0.000001,
  #             alpha=0.5,
  #             width=0.1,
  #             show.legend = F)+
  geom_point(aes(col=LOCATION,
                 text=paste("Sample: ",SAMPLE, " \n Corrected reads:",round(value,3),sep="")),size = 1,
             position='jitter',
             alpha=0.75)+
  #stat_summary(fun.data=data_summary,geom="point", size=2, color="orange")+
  stat_summary(fun=median, geom="point", size=2, color="orange")+
  scale_x_discrete(name="Species",
                   labels=labels_species)+
  ylab("Corrected reads (%)")+
  xlab("Species")+
  theme_classic()+
  scale_colour_manual(name = "",
                      labels = c("Gulf of Lion","Costa Calida","Algarve","Bay of Biscay"),
                      values = brewer.pal(n = 4, name = "RdBu"))+
  theme(legend.position="bottom")
ppp<-ggplotly(ppp,tooltip=c("text"))  %>% partial_bundle() 

if (PRINT_IMAGE==1){
img1<-readPNG(paste(path,"/figures/fish/","Aboye",".png",sep=""))
img2<-readPNG(paste(path,"/figures/fish/","Afall",".png",sep=""))
img3<-readPNG(paste(path,"/figures/fish/","Cgale",".png",sep=""))
img4<-readPNG(paste(path,"/figures/fish/","Cjuli",".png",sep=""))
img5<-readPNG(paste(path,"/figures/fish/","Dlabr",".png",sep=""))
img6<-readPNG(paste(path,"/figures/fish/","Dpunt",".png",sep=""))
img7<-readPNG(paste(path,"/figures/fish/","Eencr",".png",sep=""))
img8<-readPNG(paste(path,"/figures/fish/","Gnige",".png",sep=""))
img9<-readPNG(paste(path,"/figures/fish/","Hgutt",".png",sep=""))
img10<-readPNG(paste(path,"/figures/fish/","Lbude",".png",sep=""))
img11<-readPNG(paste(path,"/figures/fish/","Lmorm",".png",sep=""))
img12<-readPNG(paste(path,"/figures/fish/","Mmerl",".png",sep=""))
img13<-readPNG(paste(path,"/figures/fish/","Msurm",".png",sep=""))
img14<-readPNG(paste(path,"/figures/fish/","Peryt",".png",sep=""))
img15<-readPNG(paste(path,"/figures/fish/","Scabr",".png",sep=""))
img16<-readPNG(paste(path,"/figures/fish/","Scant",".png",sep=""))
img17<-readPNG(paste(path,"/figures/fish/","Scine",".png",sep=""))
img18<-readPNG(paste(path,"/figures/fish/","Spilc",".png",sep=""))
img19<-readPNG(paste(path,"/figures/fish/","Ssard",".png",sep=""))
img20<-readPNG(paste(path,"/figures/fish/","Styph",".png",sep=""))
start=0
end=0.95
vv<-seq(start,end,length.out=20)
size.x=vv[2]-vv[1]
ppp<-  ppp %>%
  layout(
    images = list(
      list(
        source = raster2uri(as.raster(img1)),
        x = vv[1], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img2)),
        x = vv[2], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img3)),
        x = vv[3], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img4)),
        x = vv[4], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img5)),
        x = vv[5], y = 1, 
        sizex = size.x, sizey = 0.05
      ),
      list(
        source = raster2uri(as.raster(img6)),
        x = vv[6], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img7)),
        x = vv[7], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img8)),
        x = vv[8], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img9)),
        x = vv[9], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img10)),
        x = vv[10], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img11)),
        x = vv[11], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img12)),
        x = vv[12], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img13)),
        x = vv[13], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img14)),
        x = vv[14],y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img15)),
        x = vv[15], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img16)),
        x = vv[16], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img17)),
        x = vv[17], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img18)),
        x = vv[18], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img19)),
        x = vv[19], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img20)),
        x = vv[20], y = 1, 
        sizex = size.x, sizey = 0.1
      )
    )
  ) 
}

ppp

```

### Corrected bases

```{r}
ppp <- ggplot(fastp_plot[fastp_plot$param=="CORRECTED_BASES",], aes(x=SPECIES, y=value))  +
  geom_violin(fill="chartreuse3",col="black",alpha=0.25) +
  #geom_boxplot(outlier.shape = NA,
  #             outlier.size = 0.000001,
  #             alpha=0.5,
  #             width=0.1,
  #             show.legend = F)+
  geom_point(aes(col=LOCATION,
                 text=paste("Sample: ",SAMPLE, " \n Corrected bases:",round(value,3),sep="")),size = 1,
             position='jitter',
             alpha=0.75)+
  #stat_summary(fun.data=data_summary,geom="point", size=2, color="orange")+
  stat_summary(fun=median, geom="point", size=2, color="orange")+
  scale_x_discrete(name="Species",
                   labels=labels_species)+
  ylab("Corrected bases (%)")+
  xlab("Species")+
  theme_classic()+
  scale_colour_manual(name = "",
                      labels = c("Gulf of Lion","Costa Calida","Algarve","Bay of Biscay"),
                      values = brewer.pal(n = 4, name = "RdBu"))+
  theme(legend.position="bottom")
ppp<-ggplotly(ppp,tooltip=c("text"))  %>% partial_bundle() 

if (PRINT_IMAGE==1){
img1<-readPNG(paste(path,"/figures/fish/","Aboye",".png",sep=""))
img2<-readPNG(paste(path,"/figures/fish/","Afall",".png",sep=""))
img3<-readPNG(paste(path,"/figures/fish/","Cgale",".png",sep=""))
img4<-readPNG(paste(path,"/figures/fish/","Cjuli",".png",sep=""))
img5<-readPNG(paste(path,"/figures/fish/","Dlabr",".png",sep=""))
img6<-readPNG(paste(path,"/figures/fish/","Dpunt",".png",sep=""))
img7<-readPNG(paste(path,"/figures/fish/","Eencr",".png",sep=""))
img8<-readPNG(paste(path,"/figures/fish/","Gnige",".png",sep=""))
img9<-readPNG(paste(path,"/figures/fish/","Hgutt",".png",sep=""))
img10<-readPNG(paste(path,"/figures/fish/","Lbude",".png",sep=""))
img11<-readPNG(paste(path,"/figures/fish/","Lmorm",".png",sep=""))
img12<-readPNG(paste(path,"/figures/fish/","Mmerl",".png",sep=""))
img13<-readPNG(paste(path,"/figures/fish/","Msurm",".png",sep=""))
img14<-readPNG(paste(path,"/figures/fish/","Peryt",".png",sep=""))
img15<-readPNG(paste(path,"/figures/fish/","Scabr",".png",sep=""))
img16<-readPNG(paste(path,"/figures/fish/","Scant",".png",sep=""))
img17<-readPNG(paste(path,"/figures/fish/","Scine",".png",sep=""))
img18<-readPNG(paste(path,"/figures/fish/","Spilc",".png",sep=""))
img19<-readPNG(paste(path,"/figures/fish/","Ssard",".png",sep=""))
img20<-readPNG(paste(path,"/figures/fish/","Styph",".png",sep=""))
start=0
end=0.95
vv<-seq(start,end,length.out=20)
size.x=vv[2]-vv[1]
ppp<-  ppp %>%
  layout(
    images = list(
      list(
        source = raster2uri(as.raster(img1)),
        x = vv[1], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img2)),
        x = vv[2], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img3)),
        x = vv[3], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img4)),
        x = vv[4], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img5)),
        x = vv[5], y = 1, 
        sizex = size.x, sizey = 0.05
      ),
      list(
        source = raster2uri(as.raster(img6)),
        x = vv[6], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img7)),
        x = vv[7], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img8)),
        x = vv[8], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img9)),
        x = vv[9], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img10)),
        x = vv[10], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img11)),
        x = vv[11], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img12)),
        x = vv[12], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img13)),
        x = vv[13], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img14)),
        x = vv[14],y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img15)),
        x = vv[15], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img16)),
        x = vv[16], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img17)),
        x = vv[17], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img18)),
        x = vv[18], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img19)),
        x = vv[19], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img20)),
        x = vv[20], y = 1, 
        sizex = size.x, sizey = 0.1
      )
    )
  ) 
}

ppp

```

### Low quality reads

```{r}
ppp <- ggplot(fastp_plot[fastp_plot$param=="LOW_QUALITY_READS",], aes(x=SPECIES, y=value))  +
  geom_violin(fill="chartreuse3",col="black",alpha=0.25) +
  #geom_boxplot(outlier.shape = NA,
  #             outlier.size = 0.000001,
  #             alpha=0.5,
  #             width=0.1,
  #             show.legend = F)+
  geom_point(aes(col=LOCATION,
                 text=paste("Sample: ",SAMPLE, " \n Low quality reads:",round(value,3),sep="")),size = 1,
             position='jitter',
             alpha=0.75)+
  #stat_summary(fun.data=data_summary,geom="point", size=2, color="orange")+
  stat_summary(fun=median, geom="point", size=2, color="orange")+
  scale_x_discrete(name="Species",
                   labels=labels_species)+
  ylab("Low quality reads (%)")+
  xlab("Species")+
  theme_classic()+
  scale_colour_manual(name = "",
                      labels = c("Gulf of Lion","Costa Calida","Algarve","Bay of Biscay"),
                      values = brewer.pal(n = 4, name = "RdBu"))+
  theme(legend.position="bottom")
ppp<-ggplotly(ppp,tooltip=c("text"))  %>% partial_bundle() 

if (PRINT_IMAGE==1){
img1<-readPNG(paste(path,"/figures/fish/","Aboye",".png",sep=""))
img2<-readPNG(paste(path,"/figures/fish/","Afall",".png",sep=""))
img3<-readPNG(paste(path,"/figures/fish/","Cgale",".png",sep=""))
img4<-readPNG(paste(path,"/figures/fish/","Cjuli",".png",sep=""))
img5<-readPNG(paste(path,"/figures/fish/","Dlabr",".png",sep=""))
img6<-readPNG(paste(path,"/figures/fish/","Dpunt",".png",sep=""))
img7<-readPNG(paste(path,"/figures/fish/","Eencr",".png",sep=""))
img8<-readPNG(paste(path,"/figures/fish/","Gnige",".png",sep=""))
img9<-readPNG(paste(path,"/figures/fish/","Hgutt",".png",sep=""))
img10<-readPNG(paste(path,"/figures/fish/","Lbude",".png",sep=""))
img11<-readPNG(paste(path,"/figures/fish/","Lmorm",".png",sep=""))
img12<-readPNG(paste(path,"/figures/fish/","Mmerl",".png",sep=""))
img13<-readPNG(paste(path,"/figures/fish/","Msurm",".png",sep=""))
img14<-readPNG(paste(path,"/figures/fish/","Peryt",".png",sep=""))
img15<-readPNG(paste(path,"/figures/fish/","Scabr",".png",sep=""))
img16<-readPNG(paste(path,"/figures/fish/","Scant",".png",sep=""))
img17<-readPNG(paste(path,"/figures/fish/","Scine",".png",sep=""))
img18<-readPNG(paste(path,"/figures/fish/","Spilc",".png",sep=""))
img19<-readPNG(paste(path,"/figures/fish/","Ssard",".png",sep=""))
img20<-readPNG(paste(path,"/figures/fish/","Styph",".png",sep=""))
start=0
end=0.95
vv<-seq(start,end,length.out=20)
size.x=vv[2]-vv[1]
ppp<-  ppp %>%
  layout(
    images = list(
      list(
        source = raster2uri(as.raster(img1)),
        x = vv[1], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img2)),
        x = vv[2], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img3)),
        x = vv[3], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img4)),
        x = vv[4], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img5)),
        x = vv[5], y = 1, 
        sizex = size.x, sizey = 0.05
      ),
      list(
        source = raster2uri(as.raster(img6)),
        x = vv[6], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img7)),
        x = vv[7], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img8)),
        x = vv[8], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img9)),
        x = vv[9], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img10)),
        x = vv[10], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img11)),
        x = vv[11], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img12)),
        x = vv[12], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img13)),
        x = vv[13], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img14)),
        x = vv[14],y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img15)),
        x = vv[15], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img16)),
        x = vv[16], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img17)),
        x = vv[17], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img18)),
        x = vv[18], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img19)),
        x = vv[19], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img20)),
        x = vv[20], y = 1, 
        sizex = size.x, sizey = 0.1
      )
    )
  ) 
}

ppp

```

### Too many N reads

```{r}
ppp <- ggplot(fastp_plot[fastp_plot$param=="TOO_MANY_N_READS",], aes(x=SPECIES, y=value))  +
  geom_violin(fill="chartreuse3",col="black",alpha=0.25) +
  #geom_boxplot(outlier.shape = NA,
  #             outlier.size = 0.000001,
  #             alpha=0.5,
  #             width=0.1,
  #             show.legend = F)+
  geom_point(aes(col=LOCATION,
                 text=paste("Sample: ",SAMPLE, " \n Too many N reads:",round(value,3),sep="")),size = 1,
             position='jitter',
             alpha=0.75)+
  #stat_summary(fun.data=data_summary,geom="point", size=2, color="orange")+
  stat_summary(fun=median, geom="point", size=2, color="orange")+
  scale_x_discrete(name="Species",
                   labels=labels_species)+
  ylab("Too many N reads (%)")+
  xlab("Species")+
  theme_classic()+
  scale_colour_manual(name = "",
                      labels = c("Gulf of Lion","Costa Calida","Algarve","Bay of Biscay"),
                      values = brewer.pal(n = 4, name = "RdBu"))+
  theme(legend.position="bottom")
ppp<-ggplotly(ppp,tooltip=c("text"))  %>% partial_bundle() 

if (PRINT_IMAGE==1){
img1<-readPNG(paste(path,"/figures/fish/","Aboye",".png",sep=""))
img2<-readPNG(paste(path,"/figures/fish/","Afall",".png",sep=""))
img3<-readPNG(paste(path,"/figures/fish/","Cgale",".png",sep=""))
img4<-readPNG(paste(path,"/figures/fish/","Cjuli",".png",sep=""))
img5<-readPNG(paste(path,"/figures/fish/","Dlabr",".png",sep=""))
img6<-readPNG(paste(path,"/figures/fish/","Dpunt",".png",sep=""))
img7<-readPNG(paste(path,"/figures/fish/","Eencr",".png",sep=""))
img8<-readPNG(paste(path,"/figures/fish/","Gnige",".png",sep=""))
img9<-readPNG(paste(path,"/figures/fish/","Hgutt",".png",sep=""))
img10<-readPNG(paste(path,"/figures/fish/","Lbude",".png",sep=""))
img11<-readPNG(paste(path,"/figures/fish/","Lmorm",".png",sep=""))
img12<-readPNG(paste(path,"/figures/fish/","Mmerl",".png",sep=""))
img13<-readPNG(paste(path,"/figures/fish/","Msurm",".png",sep=""))
img14<-readPNG(paste(path,"/figures/fish/","Peryt",".png",sep=""))
img15<-readPNG(paste(path,"/figures/fish/","Scabr",".png",sep=""))
img16<-readPNG(paste(path,"/figures/fish/","Scant",".png",sep=""))
img17<-readPNG(paste(path,"/figures/fish/","Scine",".png",sep=""))
img18<-readPNG(paste(path,"/figures/fish/","Spilc",".png",sep=""))
img19<-readPNG(paste(path,"/figures/fish/","Ssard",".png",sep=""))
img20<-readPNG(paste(path,"/figures/fish/","Styph",".png",sep=""))
start=0
end=0.95
vv<-seq(start,end,length.out=20)
size.x=vv[2]-vv[1]
ppp<-  ppp %>%
  layout(
    images = list(
      list(
        source = raster2uri(as.raster(img1)),
        x = vv[1], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img2)),
        x = vv[2], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img3)),
        x = vv[3], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img4)),
        x = vv[4], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img5)),
        x = vv[5], y = 1, 
        sizex = size.x, sizey = 0.05
      ),
      list(
        source = raster2uri(as.raster(img6)),
        x = vv[6], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img7)),
        x = vv[7], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img8)),
        x = vv[8], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img9)),
        x = vv[9], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img10)),
        x = vv[10], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img11)),
        x = vv[11], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img12)),
        x = vv[12], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img13)),
        x = vv[13], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img14)),
        x = vv[14],y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img15)),
        x = vv[15], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img16)),
        x = vv[16], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img17)),
        x = vv[17], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img18)),
        x = vv[18], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img19)),
        x = vv[19], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img20)),
        x = vv[20], y = 1, 
        sizex = size.x, sizey = 0.1
      )
    )
  ) 
}

ppp

```

### Too short reads

```{r}
ppp <- ggplot(fastp_plot[fastp_plot$param=="TOO_SHORT_READS",], aes(x=SPECIES, y=value))  +
  geom_violin(fill="chartreuse3",col="black",alpha=0.25) +
  #geom_boxplot(outlier.shape = NA,
  #             outlier.size = 0.000001,
  #             alpha=0.5,
  #             width=0.1,
  #             show.legend = F)+
  geom_point(aes(col=LOCATION,
                 text=paste("Sample: ",SAMPLE, " \n Too short reads:",round(value,3),sep="")),size = 1,
             position='jitter',
             alpha=0.75)+
  #stat_summary(fun.data=data_summary,geom="point", size=2, color="orange")+
  stat_summary(fun=median, geom="point", size=2, color="orange")+
  scale_x_discrete(name="Species",
                   labels=labels_species)+
  ylab("Too short reads (%)")+
  xlab("Species")+
  theme_classic()+
  scale_colour_manual(name = "",
                      labels = c("Gulf of Lion","Costa Calida","Algarve","Bay of Biscay"),
                      values = brewer.pal(n = 4, name = "RdBu"))+
  theme(legend.position="bottom")
ppp<-ggplotly(ppp,tooltip=c("text"))  %>% partial_bundle()  

if (PRINT_IMAGE==1){
img1<-readPNG(paste(path,"/figures/fish/","Aboye",".png",sep=""))
img2<-readPNG(paste(path,"/figures/fish/","Afall",".png",sep=""))
img3<-readPNG(paste(path,"/figures/fish/","Cgale",".png",sep=""))
img4<-readPNG(paste(path,"/figures/fish/","Cjuli",".png",sep=""))
img5<-readPNG(paste(path,"/figures/fish/","Dlabr",".png",sep=""))
img6<-readPNG(paste(path,"/figures/fish/","Dpunt",".png",sep=""))
img7<-readPNG(paste(path,"/figures/fish/","Eencr",".png",sep=""))
img8<-readPNG(paste(path,"/figures/fish/","Gnige",".png",sep=""))
img9<-readPNG(paste(path,"/figures/fish/","Hgutt",".png",sep=""))
img10<-readPNG(paste(path,"/figures/fish/","Lbude",".png",sep=""))
img11<-readPNG(paste(path,"/figures/fish/","Lmorm",".png",sep=""))
img12<-readPNG(paste(path,"/figures/fish/","Mmerl",".png",sep=""))
img13<-readPNG(paste(path,"/figures/fish/","Msurm",".png",sep=""))
img14<-readPNG(paste(path,"/figures/fish/","Peryt",".png",sep=""))
img15<-readPNG(paste(path,"/figures/fish/","Scabr",".png",sep=""))
img16<-readPNG(paste(path,"/figures/fish/","Scant",".png",sep=""))
img17<-readPNG(paste(path,"/figures/fish/","Scine",".png",sep=""))
img18<-readPNG(paste(path,"/figures/fish/","Spilc",".png",sep=""))
img19<-readPNG(paste(path,"/figures/fish/","Ssard",".png",sep=""))
img20<-readPNG(paste(path,"/figures/fish/","Styph",".png",sep=""))
start=0
end=0.95
vv<-seq(start,end,length.out=20)
size.x=vv[2]-vv[1]
ppp<-  ppp %>%
  layout(
    images = list(
      list(
        source = raster2uri(as.raster(img1)),
        x = vv[1], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img2)),
        x = vv[2], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img3)),
        x = vv[3], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img4)),
        x = vv[4], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img5)),
        x = vv[5], y = 1, 
        sizex = size.x, sizey = 0.05
      ),
      list(
        source = raster2uri(as.raster(img6)),
        x = vv[6], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img7)),
        x = vv[7], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img8)),
        x = vv[8], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img9)),
        x = vv[9], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img10)),
        x = vv[10], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img11)),
        x = vv[11], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img12)),
        x = vv[12], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img13)),
        x = vv[13], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img14)),
        x = vv[14],y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img15)),
        x = vv[15], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img16)),
        x = vv[16], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img17)),
        x = vv[17], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img18)),
        x = vv[18], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img19)),
        x = vv[19], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img20)),
        x = vv[20], y = 1, 
        sizex = size.x, sizey = 0.1
      )
    )
  ) 
}

ppp

```

### Low complexity reads

```{r}
ppp <- ggplot(fastp_plot[fastp_plot$param=="LOW_COMPLEXITY_READS",], aes(x=SPECIES, y=value))  +
  geom_violin(fill="chartreuse3",col="black",alpha=0.25) +
  #geom_boxplot(outlier.shape = NA,
  #             outlier.size = 0.000001,
  #             alpha=0.5,
  #             width=0.1,
  #             show.legend = F)+
  geom_point(aes(col=LOCATION,
                 text=paste("Sample: ",SAMPLE, " \n Low complexity reads:",round(value,3),sep="")),size = 1,
             position='jitter',
             alpha=0.75)+
  #stat_summary(fun.data=data_summary,geom="point", size=2, color="orange")+
  stat_summary(fun=median, geom="point", size=2, color="orange")+
  scale_x_discrete(name="Species",
                   labels=labels_species)+
  ylab("Low complexity reads (%)")+
  xlab("Species")+
  theme_classic()+
  scale_colour_manual(name = "",
                      labels = c("Gulf of Lion","Costa Calida","Algarve","Bay of Biscay"),
                      values = brewer.pal(n = 4, name = "RdBu"))+
  theme(legend.position="bottom")
ppp<-ggplotly(ppp,tooltip=c("text"))  %>% partial_bundle() 

if (PRINT_IMAGE==1){
img1<-readPNG(paste(path,"/figures/fish/","Aboye",".png",sep=""))
img2<-readPNG(paste(path,"/figures/fish/","Afall",".png",sep=""))
img3<-readPNG(paste(path,"/figures/fish/","Cgale",".png",sep=""))
img4<-readPNG(paste(path,"/figures/fish/","Cjuli",".png",sep=""))
img5<-readPNG(paste(path,"/figures/fish/","Dlabr",".png",sep=""))
img6<-readPNG(paste(path,"/figures/fish/","Dpunt",".png",sep=""))
img7<-readPNG(paste(path,"/figures/fish/","Eencr",".png",sep=""))
img8<-readPNG(paste(path,"/figures/fish/","Gnige",".png",sep=""))
img9<-readPNG(paste(path,"/figures/fish/","Hgutt",".png",sep=""))
img10<-readPNG(paste(path,"/figures/fish/","Lbude",".png",sep=""))
img11<-readPNG(paste(path,"/figures/fish/","Lmorm",".png",sep=""))
img12<-readPNG(paste(path,"/figures/fish/","Mmerl",".png",sep=""))
img13<-readPNG(paste(path,"/figures/fish/","Msurm",".png",sep=""))
img14<-readPNG(paste(path,"/figures/fish/","Peryt",".png",sep=""))
img15<-readPNG(paste(path,"/figures/fish/","Scabr",".png",sep=""))
img16<-readPNG(paste(path,"/figures/fish/","Scant",".png",sep=""))
img17<-readPNG(paste(path,"/figures/fish/","Scine",".png",sep=""))
img18<-readPNG(paste(path,"/figures/fish/","Spilc",".png",sep=""))
img19<-readPNG(paste(path,"/figures/fish/","Ssard",".png",sep=""))
img20<-readPNG(paste(path,"/figures/fish/","Styph",".png",sep=""))
start=0
end=0.95
vv<-seq(start,end,length.out=20)
size.x=vv[2]-vv[1]
ppp<-  ppp %>%
  layout(
    images = list(
      list(
        source = raster2uri(as.raster(img1)),
        x = vv[1], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img2)),
        x = vv[2], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img3)),
        x = vv[3], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img4)),
        x = vv[4], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img5)),
        x = vv[5], y = 1, 
        sizex = size.x, sizey = 0.05
      ),
      list(
        source = raster2uri(as.raster(img6)),
        x = vv[6], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img7)),
        x = vv[7], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img8)),
        x = vv[8], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img9)),
        x = vv[9], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img10)),
        x = vv[10], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img11)),
        x = vv[11], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img12)),
        x = vv[12], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img13)),
        x = vv[13], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img14)),
        x = vv[14],y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img15)),
        x = vv[15], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img16)),
        x = vv[16], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img17)),
        x = vv[17], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img18)),
        x = vv[18], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img19)),
        x = vv[19], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img20)),
        x = vv[20], y = 1, 
        sizex = size.x, sizey = 0.1
      )
    )
  ) 
}

ppp

```

### Duplication rate

```{r}
ppp <- ggplot(fastp_plot[fastp_plot$param=="DUPLICATION_RATE",], aes(x=SPECIES, y=value))  +
  geom_violin(fill="chartreuse3",col="black",alpha=0.25) +
  #geom_boxplot(outlier.shape = NA,
  #             outlier.size = 0.000001,
  #             alpha=0.5,
  #             width=0.1,
  #             show.legend = F)+
  geom_point(aes(col=LOCATION,
                 text=paste("Sample: ",SAMPLE, " \n Duplication rate:",round(value,3),sep="")),size = 1,
             position='jitter',
             alpha=0.75)+
  #stat_summary(fun.data=data_summary,geom="point", size=2, color="orange")+
  stat_summary(fun=median, geom="point", size=2, color="orange")+
  scale_x_discrete(name="Species",
                   labels=labels_species)+
  ylab("Duplication rate (%)")+
  xlab("Species")+
  theme_classic()+
  scale_colour_manual(name = "",
                      labels = c("Gulf of Lion","Costa Calida","Algarve","Bay of Biscay"),
                      values = brewer.pal(n = 4, name = "RdBu"))+
  theme(legend.position="bottom")
ppp<-ggplotly(ppp,tooltip=c("text"))  %>% partial_bundle() 

if (PRINT_IMAGE==1){
img1<-readPNG(paste(path,"/figures/fish/","Aboye",".png",sep=""))
img2<-readPNG(paste(path,"/figures/fish/","Afall",".png",sep=""))
img3<-readPNG(paste(path,"/figures/fish/","Cgale",".png",sep=""))
img4<-readPNG(paste(path,"/figures/fish/","Cjuli",".png",sep=""))
img5<-readPNG(paste(path,"/figures/fish/","Dlabr",".png",sep=""))
img6<-readPNG(paste(path,"/figures/fish/","Dpunt",".png",sep=""))
img7<-readPNG(paste(path,"/figures/fish/","Eencr",".png",sep=""))
img8<-readPNG(paste(path,"/figures/fish/","Gnige",".png",sep=""))
img9<-readPNG(paste(path,"/figures/fish/","Hgutt",".png",sep=""))
img10<-readPNG(paste(path,"/figures/fish/","Lbude",".png",sep=""))
img11<-readPNG(paste(path,"/figures/fish/","Lmorm",".png",sep=""))
img12<-readPNG(paste(path,"/figures/fish/","Mmerl",".png",sep=""))
img13<-readPNG(paste(path,"/figures/fish/","Msurm",".png",sep=""))
img14<-readPNG(paste(path,"/figures/fish/","Peryt",".png",sep=""))
img15<-readPNG(paste(path,"/figures/fish/","Scabr",".png",sep=""))
img16<-readPNG(paste(path,"/figures/fish/","Scant",".png",sep=""))
img17<-readPNG(paste(path,"/figures/fish/","Scine",".png",sep=""))
img18<-readPNG(paste(path,"/figures/fish/","Spilc",".png",sep=""))
img19<-readPNG(paste(path,"/figures/fish/","Ssard",".png",sep=""))
img20<-readPNG(paste(path,"/figures/fish/","Styph",".png",sep=""))
start=0
end=0.95
vv<-seq(start,end,length.out=20)
size.x=vv[2]-vv[1]
ppp<-  ppp %>%
  layout(
    images = list(
      list(
        source = raster2uri(as.raster(img1)),
        x = vv[1], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img2)),
        x = vv[2], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img3)),
        x = vv[3], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img4)),
        x = vv[4], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img5)),
        x = vv[5], y = 1, 
        sizex = size.x, sizey = 0.05
      ),
      list(
        source = raster2uri(as.raster(img6)),
        x = vv[6], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img7)),
        x = vv[7], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img8)),
        x = vv[8], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img9)),
        x = vv[9], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img10)),
        x = vv[10], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img11)),
        x = vv[11], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img12)),
        x = vv[12], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img13)),
        x = vv[13], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img14)),
        x = vv[14],y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img15)),
        x = vv[15], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img16)),
        x = vv[16], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img17)),
        x = vv[17], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img18)),
        x = vv[18], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img19)),
        x = vv[19], y = 1, 
        sizex = size.x, sizey = 0.1
      ),
      list(
        source = raster2uri(as.raster(img20)),
        x = vv[20], y = 1, 
        sizex = size.x, sizey = 0.1
      )
    )
  ) 
}

ppp

```

Packages used {data-icon="fa-map"}
=======================================================================

```{r}
installed.packages()[names(sessionInfo()$otherPkgs), "Version"]
```